﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;
using vite_entity.Entities;

namespace vite_entity.EntityTypeConfig
{
    public class SysMessage_TypeConfig : IEntityTypeConfiguration<SysMessage>
    {
        public void Configure(EntityTypeBuilder<SysMessage> entity)
        {
            entity.HasKey(e => e.Id).HasName("PRIMARY");

            entity
                .ToTable("sys_message", tb => tb.HasComment("系统消息"))
                .UseCollation("utf8mb4_general_ci");

            entity.Property(e => e.Id)
                .HasComment("主键")
                .HasColumnName("id");
            entity.Property(e => e.CreateBy)
                .HasComment("创建人ID")
                .HasColumnName("create_by");
            entity.Property(e => e.CreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("create_time");
            entity.Property(e => e.IsDeleted)
                .HasComment("逻辑删除标识(1-已删除 0-未删除)")
                .HasColumnName("is_deleted");
            entity.Property(e => e.UpdateBy)
                .HasComment("修改人ID")
                .HasColumnName("update_by");
            entity.Property(e => e.UpdateTime)
                .HasComment("更新时间")
                .HasColumnType("datetime")
                .HasColumnName("update_time");
        }
    }
}
